/*
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2021-12-18 17:58:52
 */
import { axios } from '../../utils/request'

/**
 * 销售订单
 */
const api = {
    save: '/so/saleOrder/save',
    examine: '/so/saleOrder/examine',
    delete: '/so/saleOrder/delete',
    getcode: '/so/saleOrder/getCode',

    saveOrder: '/so/deliveryMain/saveOrderForWarehouse',//保存发货单(根据仓库 分单)

    closed: '/so/saleOrder/closed',
}

/**
 * 打开or关闭
 */
export function closed(data) {
    return axios({
        url: api.closed,
        method: "get",
        params: data
    })
}


/**
 * 保存
 */
export function save (data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}
/**
 * 保存发货单
 */
export function saveOrderForWarehouse (data) {
    return axios({
        url: api.saveOrder,
        method: "post",
        data: data
    })
}


/**
 * 审核
 */
export function examine (data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除
 */
export function remove (data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取单据编号
 */
export function getCode (data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}


/**
 * 单据提交
 */
export function submitOrder (data) {
    return axios({
        url: '/so/saleOrder/submit',
        method: "get",
        params: data
    })
}
